home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-23 | 424 b | 21 lines | [appl/MiNT] |
- #!/usr/bin/perl
- # usage: perl crtype <file...>
- # tell what kind of end of line convention is used.
-
- while ($file = shift(@ARGV)) {
- last unless open(F, "<$file");
- binmode(F);
- while (1) {
- $type = "Unknown";
- last unless read(F, $buf, 1024);
- $type = "DOS";
- last if $buf =~ "\r\n";
- $type = "Mac";
- last if $buf =~ "\r";
- $type = "UNIX";
- last if $buf =~ "\n";
- }
- print "'$file': $type\n";
- close(F);
- }
-